Rendering the Page on the Printing Device
QuickDraw GX sends theGXRenderPage
message once for each page, when the QuickDraw GX shape that is the picture of the page needs to be translated into a stream of data that the printing device can use to render the output page. QuickDraw GX's default implementation for this function handles most of the work for you. For a raster printing device, it converts the page into bitmap data and sends theGXRasterPackageBitmap
message before sending the bitmap to the printing device. When the raster printing-device head has to be moved down the page, QuickDraw GX sends theGXRasterLineFeed
message.Printing is accomplished by adding bytes of data to a buffer that you send to the printing device with the
GXBufferData
message.The ImageWriter II printer driver overrides the
GXRenderPage
message to add its own operations. Its override function,SD_RenderPage
, determines if the page is to be printed in text mode or not. If so, it calls the local functionPrintPageInDraftMode
to do the printing. If the page is printed in graphics mode,SD_RenderPage
sends escape sequences to the printing device to set up the page size and then forwards theGXRenderPage
message so that the default implementation can manage the page printing. TheGXRenderPage
message is described on page 4-96 in the chapter "Printing Messages."The ImageWriter II printer driver overrides the
GXRasterLineFeed
message with theSD_LineFeed
function. This function adjusts the line-feed size if the driver is printing at low resolution because the ImageWriter II assumes that line-feed commands are expressed in high-resolution values.SD_LineFeed
forwards theGXRasterLineFeed
message to allow the default implementation to send the appropriate escape sequences to the printing device. TheGXRasterLineFeed
message is described on page 4-98 in the chapter "Printing Messages."The ImageWriter II printer driver also overrides the
GXRasterPackageBitmap
message. TheSD_PackageBitmap
override function fills in a buffer with the
raster data, applying ImageWriter II run-length encoding and rotating the data.
TheGXRasterPackageBitmap
message is described on page 4-100 in the chapter "Printing Messages."The
SD_RenderPage
,SD_LineFeed
, andSD_PackageBitmap
override functions are shown in the QuickDraw GX sample code.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help